package org.gwc.mapper;

import org.apache.ibatis.annotations.Param;
import org.gwc.pojo.Employee;

import java.util.List;

/**
 * 测试sql动态语句
 */
public interface EmployeeMapper {

    List<Employee> selectAll();
    List<Employee> selectByNameAndSalary(@Param("name") String name, @Param("salary") double salary);

    int update(Employee employee);

    // 满足一个查询条件即结束
    List<Employee> selectByChoose(@Param("name") String name, @Param("salary") double salary);

    // 对于是集合的参数，需要@Param指定参数名
    List<Employee> selectBatch(@Param("ids") List<Integer> ids);
    int updateBatch(@Param("employees") List<Employee> employees);
    int insertBatch(@Param("employees") List<Employee> employees);

}
